<!--合伙人规则-->
<template>
  <div class="bg">
    <scroller class="scroller">
      <div class="wrapper">
      <!--头部图片-->
      <LImage :src="Config.img(isEnd ? 'hhr_activty_top_en.png' : 'hhr_activty_top.png')" class="head-image"></LImage>

      <!-- 简介-->
      <div class="jianjie-bg">
        <text class="jianjie-text">{{'* '+T('升级为合伙人，好友接受您的邀请注册后，通过Vtrading平台在部分合作的交易所进行实盘交易，您将获得相应比例的交易奖励(0手续费的交易对不参与活动)。')}}</text>
        <div class="jianjie-jianjv"></div>
        <text class="jianjie-text">{{'* '+T('Vtrading量化天生高频交易，交易量最高可达普通交易的50倍。')}}</text>
        <div class="jianjie-jianjv"></div>
        <text class="jianjie-text">{{'* '+T('邀请好友使用Vtrading专属链接注册交易所账户您可获得更高额交易奖励。')}}</text>
      </div>

      <!--权益-->
      <div class="tbale-bg">
        <div class="table">
          <div class="table-row">
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('等级')}}</text></div>
            <div class="table-cell table-cell-2"><text class="table-text-align table-cell-2">{{T('合伙等级门槛')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('交易奖励')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('额外奖励')}}</text></div>
          </div>
            <div class="table-row">
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('Level 1')}}</text></div>
            <div class="table-cell table-cell-2"><text class="table-text table-cell-2">{{T('累计邀请30名新注册用户，其中至少5名交易。')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('100%')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('20%')}}</text></div>
          </div>
          <div class="table-row">
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('Level 2')}}</text></div>
            <div class="table-cell table-cell-2"><text class="table-text table-cell-2">{{T('累计邀请100名新注册用户，其中至少有15名交易。')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('100%')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('30%')}}</text></div>
          </div>
          <div class="table-row">
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('Level 3')}}</text></div>
            <div class="table-cell table-cell-2"><text class="table-text table-cell-2">{{T('累计邀请400名新注册用户，其中至少有50名交易。')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('100%')}}</text></div>
            <div class="table-cell table-cell-1"><text class="table-text-align table-cell-1">{{T('50%')}}</text></div>
          </div>
        </div>
      </div>

      <!--说明-->
      <div class="shuoming-bg">
        <div>
          <div class="shuoming">
            <div class="shuoming-badge-bg"><text class="shuoming-badge">1</text></div>
            <text class="shuoming-text">{{T('合伙人等级共三档，欢迎具备渠道或社群拉新能力的用户与官方联系，经初步判断可评定为相应等级。')}}</text>
          </div>
          <div class="shuoming">
            <div class="shuoming-badge-bg"><text class="shuoming-badge">2</text></div>
            <text class="shuoming-text">{{T('各个等级对应不同的交易奖励比例，比例系数100%即为全额交易奖励，额外部分为官方加倍奖励。')}}</text>
          </div>
          <div class="shuoming">
            <div class="shuoming-badge-bg"><text class="shuoming-badge">3</text></div>
            <text class="shuoming-text">{{T('交易部分您可按设定的比例与好友分配，平台额外奖励部分不参与分配。')}}</text>
          </div>
          <div class="shuoming">
            <div class="shuoming-badge-bg"><text class="shuoming-badge">4</text></div>
            <text class="shuoming-text">{{T('您可以重新设置同好友的奖励分配比例，分配比例调整当期生效，历史已分配的奖励不受影响。')}}</text>
          </div>
          <div class="shuoming">
            <div class="shuoming-badge-bg"><text class="shuoming-badge">5</text></div>
            <text class="shuoming-text">{{T('奖励每日结算（为保证系统正常运行，首次奖励将在上线一周后统一发放）。')}}</text>
          </div>
          <div class="shuoming">
            <div class="shuoming-badge-bg"><text class="shuoming-badge">6</text></div>
            <text class="shuoming-text">{{T('通过违规行为（包括但不限于利用规则漏洞或平台bug等形式）获取的奖励，平台有权收回，严重者将予以永久冻结账号处理。')}}</text>
          </div>
          
          <!-- <div @click="weixing" class="shuoming">
            <div class="row">
              <div class="shuoming-badge-bg"><text class="shuoming-badge">7</text></div>
              <text class="weixing-text">{{T('官方微信号：')}}</text>
              <text class="weixing-but">{{URL}}</text>
            </div>
          </div> -->

          <div class="jianjie-jianjv"></div>
          <text class="jianjie-text">{{T('* 以上规则最终解释权归Vtrading所有，所有规则变动均以官方公告为准。')}}</text>
        </div>
      </div>
      </div>
    </scroller>

    <div @click="httpsIsPartner" class="yaoqing-but">
      <text class="yaoqing-but-text">{{T('立即邀请')}}</text>
    </div>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
.bg {
  background-color:rgba(255,216,185,1);
  width: 750px;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.scroller {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
}
.wrapper{
  flex-direction: column;
  align-items: center;
  width:750px;
  padding-bottom: 60px;
}
.row{
  flex-direction: row;
  align-items: center;
}

/*头部图片*/
.head-image{
  width: 750px;
  height: 512px;
}

/*简介*/
.jianjie-bg{
  flex-direction: column;
  justify-content: center;
  align-items: center;

  margin-top: 30px;
  width: 650px;
}
.jianjie-text {
  width: 650px;
  font-size:26px;
  font-family:PingFang SC;
  font-weight:400;
  color:rgba(101,53,0,1);
}
.jianjie-jianjv{
  height: 26px;
}


/*权益*/
.tbale-bg{
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  padding: 10px;
  background-color:#FFEFE4;
}
.table{
  flex-direction: column;
  border-left-width: 2px;
  border-left-color: #FB6B49;
  border-top-width: 2px;
  border-top-color: #FB6B49;
}
.table-row{
  flex-direction: row;
  border-bottom-width: 2px;
  border-bottom-color: #FB6B49;
}
.table-cell{
  flex-direction: row;
  justify-content: center;
  align-items: center;
  
  border-right-width: 2px;
  border-right-color: #FB6B49;
}
.table-cell-1{
  width:130px;
}
.table-cell-2{
  width:260px;
}
.table-text{
  padding: 20px;
  height: auto;
  font-size:20px;
  font-family:PingFang SC;
  font-weight:500;
  color:rgba(101,53,0,1);
}
.table-text-align{
  padding: 20px;
  height: auto;
  text-align: center;
  font-size:20px;
  font-family:PingFang SC;
  font-weight:500;
  color:rgba(101,53,0,1);
}

/*说明*/
.shuoming-bg{
  flex-direction: column;
  justify-content: center;
  align-items: center;

  margin-top: 40px;
  width: 650px;
}
.shuoming{
  flex-direction: row;
  align-items: flex-start;
  margin-top: 30px;
}
.shuoming-badge-bg{
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 5px;
  margin-right: 10px;
  width:30px;
  height:30px;
  background-color:rgba(101,53,0,1);
  border-radius: 30px;
}
.shuoming-badge{
  font-size:25px;
  font-family:PingFang SC;
  font-weight:500;
  color:rgba(255,216,185,1);
  line-height:36px;
}
.shuoming-text{
  width: 610px;
  font-size:26px;
  font-family:PingFang SC;
  font-weight:400;
  color:rgba(101,53,0,1);
}
.weixing-text{
  font-size:26px;
  font-family:PingFang SC;
  font-weight:400;
  color:rgba(101,53,0,1);
}
.weixing-but {
  font-size:30px;
  font-family:PingFang SC;
  font-weight:400;
  color:rgba(35,172,255,1);
}

/*立即邀请*/
.yaoqing-but{
  position: absolute;

  flex-direction: row;
  justify-content: center;
  align-items: center;

  padding-left: 32.5px;
  padding-right: 32.5px;
  height:65px;
  background-image: linear-gradient(to bottom right, rgba(255,156,26,1), rgba(255,236,85,1));
  box-shadow:0px 3px 5px 0px rgba(227,69,3,0.4);
  border-top-left-radius: 65px;
  border-bottom-left-radius: 65px;
  right: 0;
  bottom: 200px;
}
.yaoqing-but-text{
  font-size:30px;
  font-family:PingFang SC;
  font-weight:bold;
  color:rgba(189,77,3,1);
}
</style>

<script>
import jnavigator from "@/_js/navigator";
import jmodal from "@/_js/modal";
import jconfig from "@/_js/config";
import jhttps from "@/_js/https"; ;

const weexFunction = weex.requireModule("WeexFunction");

import I18N from "@/_i18n/i18n";
var T = I18N.t;
weexFunction.setTitle(T("合伙人"));

export default {
  
  data() {
    return {
      T:T,
      Config:jconfig,
      isEnd:false, //true 英文
      
      URL:"vtrading005",
    };
  },

  created() {
    this.isEnd = weex.config.language == 'en';
  },

  methods: {

    //合伙人判断
    httpsIsPartner(){
      jmodal.showLoad();
      var param = {};
      jhttps.post("partner/isPartner",param,true,(data)=>{
        if(data.status == 200){
          data = data.data;
          if(data.isPartner){ //合伙人
            this.httpsPartnerHome();
          } else { //普通用户
            this.httpsInviteHome();
          }
        }else{
        jmodal.hideLoad();
          jmodal.toast(data.msg);
        }
      });
    },

    //http合伙人首页
    httpsPartnerHome(){

      var param = {};
      jhttps.post("partner/queryParnterInvitePage",param,true,(data)=>{
        jmodal.hideLoad();
        if(data.status == 200){
          data = data.data;
          this.partnerShare(data);
        }else{
          jmodal.toast(data.msg);
        }
      });
    },

    //http普通用户邀请首页
    httpsInviteHome(){

      var param = {};
      jhttps.postX("systemV2/queryInviteDetail",param,true,(data)=>{
        jmodal.hideLoad();
        if(data.status == 200){
          data = data.data;
          this.inviteShare(data);
        }else{
          jmodal.toast(data.msg);
        }
      });
    },

    //合伙人分享
    partnerShare(data){
      
      var scale = data.inviteMap.proportion * 100 + "";
      var code = data.inviteMap.inviteCode;
      var param = {'inviteScale':scale, 'inviteCode':code};
      jnavigator.openDialog('share/ShareInviteHome', param);
    },

    //普通用户分享
    inviteShare(data){

      var param = {'inviteCode':data.inviteCode};
      jnavigator.openDialog('share/ShareInviteHome', param);
    },

    //微信
    weixing(){
      jnavigator.openDialog("mine/DialogWx");
    },
  }
};
</script>
